home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Algorithms for Image Analysis
/
Practical Algorithms for Image Analysis.iso
/
CH_6.1
/
SPP
/
VOR_IO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1999-09-11
|
912b
|
48 lines
/*
* vor_io.c
*
* Practical Algorithms for Image Analysis
*
* Copyright (c) 1997, 1998, 1999 MLMSoftwareGroup, LLC
*/
/*
* VOR_IO.C
*
* I/O routines employed by xvor.c and associated modules
*
*/
#include <stdio.h>
#include "spp.h"
/*
* write_vin_file()
* DESCRIPTION:
* write .vin file (->Voronoi diagram)
* ARGUMENTS:
* file: pointer to open FILE
* n: number of Pix elements (int)
* ymin: ymin (int)
* xmin: xmin (int)
* xmax: xmax (int)
* ymax: ymax (int)
* Cxy: Pix array (Pix *)
* RETURN VALUE:
* none
*/
void
write_vin_file (FILE * file, int n, int xmin, int ymin, int xmax, int ymax, struct Pix *Cxy)
{
int i;
fprintf (file, "%d %f %f %f %f\n",
n, (float) xmin, (float) xmax, (float) ymin, (float) ymax);
for (i = 0; i < n; i++)
fprintf (file, "%f %f\n", (float) ((Cxy + i)->x), (float) ((Cxy + i)->y));
}